using System;
using System.Collections;
using System.Collections.Generic;

namespace IMSAT.OFTD.DOM.DataProxy
{
    public class DataCollection:IDataNodeCollection
    {
        private ICollection<IDataNode> ChildCollection { get; set; }

        public IEnumerator<IDataNode> GetEnumerator()
        {
            return ChildCollection.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public string Name { get; private set; }

        public DataCollection(ICollection<IDataNode> childCollection, string name)
        {
            ChildCollection = childCollection;
            Name = name;
        }

        public void Add(IDataNode node)
        {
            ChildCollection.Add(node);
        }
    }
}